import request from "@/utils/request";

// 新建文章
export async function create(params) {
  return request(`/article/`, {
    method: 'POST',
    data: params
  })
}

// 文章列表
export async function getList(params) {
  return request(`/api/article/list/`, {
    params
  })
}


// 文章详情
export async function getDetail(id) {
  return request(`/api/article/detail/${id}/`)
}

// 文章评论
export async function createComment(id, params) {
  return request(`/article/${id}/comments/`, {
    method: 'POST',
    data: params
  })
}

// 获取文章评论
export async function getCommentList(id) {
  return request(`/article/${id}/comments/`)
}
